Moved a few parts to clean up