Cleanup

Cleanup,  split off from pull request 738