modularized local player logic into a module