added basic helpers and simple error handling