refactored; added comments; started to add user profile loading on browser startup