refactor into proper OO classes