ReFact. #1 separate main functionality to methods
Remove whitespace