Improved commentary and added macros to make life easier in the login method