sorted the members and code refactoring