Cleanup code submitted in #1