Small refactor and cleanup
Some better error handling
closes #10