Refactoring the Gist class