Source-model and a few minor optimizations
Another minor optimization