Use Gleam class instead of object factory
Updated tests to get better coverage