private void getMainPage(HttpServletResponse response, UserSession session, Map<String, Object> pageVariables) throws ServletException, IOException {
        Long userId = (session != null) ? session.getId() : null;
        if (userId != null) {
            pageVariables.put("userId", userId);
            pageVariables.put("userName", session.getName());
            sendResponse(response, Templates.USER_TPL, pageVariables);
        } else {
            sendResponse(response, Templates.MAIN_TPL, pageVariables);
        }
    }