removed legacy prints
refactored error handling in protocol_core