small improvements and cleanup