Minor improvements and cleanup
Work in progress