Refactor range