Cleanup and minor improvement