tests and separate operations logic