code refactoring and clarification