refactoring to improve usability