Use Gleam class instead of object factory