I don't like huge `for` statement. Maybe we could separate each `if` action into another methods? What do you think? It would make code more readable IMO.