Issue #1: simplified the code, eliminated a class