First (incomplete) implementation of order process + fixes and refactoring