Refactored 3 classes into one