updated reloader and finished refactoring
error handling for reloading