refactoring code combat mission