javascript cleanup and refactoring
more dynamicism to user info