Refactoring. Added index keys