Moved duplicate functions to the common folder