Refactored class and commented