Moved code in a more logical area