Refactor singularity generator.'
Merge pull request #776 from ESwordTheCat/7b#vbri1

Refactor singularity generator.'