refactoring into simple methods
better console output