refactored, added user class.