Better error handling and dev stuff removed