refactoring to make life easier