extract terrible method to its own class instead