Adding range data and refactoring