refactoring, added basic orderer functionality