refactoring page for logged in user