reorganized into class hierarchy