refactor (see diff)