Moved code around