refactored signout code into into the layout template