Minor changes to code arrangement