Adds inactive/active order support + Refactor