Refactor operation functions