Significant performance improvements and refactoring with Fragment