clean up and small improvements