refactored with gab