Moved a few functions