refactor (again)