Restructure orientate functions and add compact function