Added layout logic and user_auth