Review comprehension syntax and do major refactoring