Refactoring Registration and Login classes