use python 3 compatible classes and clean up naming