refactor move gen to increase speed