improve several class definitions