Refactored to use simple method + class definitions