moving classes, error handling, ready for production