protected function prepareToSave($classname, array $params = [], array $paramsFromSession = null)
    {
        $column = $params['column'];
        $return = [];
        if (is_null($paramsFromSession)) {
            $return[$column]['classname'] = $classname;
            $return[$column]['values']    = [$params['value']];
            //this chunk of code will automatically add custom $params values
            //everything else then 'value' will be saved in session
            //this allow developer to send custom parameters through request
            foreach ($params as $key => $value) {
                if ($key == 'value') {
                    continue;
                }
                $return[$column][$key . 's'] = [$params[$key]];
            }
        } elseif (isset($paramsFromSession[$column])) {
            $paramsFromSession[$column]['values'][] = $params['value'];
            //this chunk of code will automatically add custom $params values
            //everything else then 'value' will be add to already existing key in session and saved
            //this allow developer to send custom parameters through request
            foreach ($params as $key => $value) {
                if ($key == 'value') {
                    continue;
                }
                $paramsFromSession[$column][$key . 's'][] = $params[$key];
                $return[$column][$key . 's']              = $paramsFromSession[$column][$key . 's'];
            }

            $return[$column]['values']    = $paramsFromSession[$column]['values'];
            $return[$column]['classname'] = $classname;
        } else {
            $return                       = $paramsFromSession;
            $return[$column]['classname'] = $classname;
            $return[$column]['values']    = [$params['value']];

            //this chunk of code will automatically add custom $params values
            //everything else then 'value' will be saved in session
            //this allows developer to send custom parameters through request 
            foreach ($params as $key => $value) {
                if ($key == 'value') {
                    continue;
                }
                $return[$column][$key . 's'] = [$params[$key]];
            }
        }
        if (!empty($paramsFromSession)) {
            foreach ($paramsFromSession as $storedColumn => $config) {
                if ($storedColumn == $column) {
                    continue;
                }
                $return[$storedColumn] = $config;
            }
        }
        return $return;
    }