Moved functions to gitlib