refactor logging class and improve error page