refactor range operator