refactor: better organisation of the wrapper class + side effect fixups