refactor counting enemies