Complete refactor to set implementation