User account added and code refactored