Cleaning up code to handle multiaxis display