some small improvements and fix import errors