refactored gist functions to its own file