Further fixes & cleanup
Merge pull request #3 from pozdnyakov/orientrefac

Further fixes & cleanup