handle_attach in model
handle_attach in model, OrdersController cleanup
some refactoring
merge bugfixing into master