pull out moving logic into its own module and break up complex methods