crazy unreadable refactor
more dumb refactor