formatted errors, factored code
update exports
Merge pull request #129 from StDako/master

formatted errors, factored code