refactoring for op