Refactoring of move calculator