created user class, refactored all functions for this