Change to indexing from filtering for performance
Tidy up