Refactoring server var handling