Moved start logic out of the lib file