Updated needed functions before clone

This should later on get refactored into one file which only contains
helper functions