Refactor classes for improved reuse