Moved functions arround