remove magic string mapping, better error handling messages