improved InOutOperations class with better structure