cleanup and fix __repr__