Further simplification ideas
Further refactoring