Bugfix and Refactoring

- Fixing bugs in the function "cancel order"
- Refactoring multiple files