Partial refactor with Sets instead Lists