move set implementations into lib