refactored a little, removed console output