refactoring based on some testing #16