Fix to variables usage in template and splitting of client and server classes