Refactor and make orientation settable