Replace io:format with error_logger
Refactored ocs module