Moved a few functions here and there