Cleanup code

And fix ID name generation. @prog no longer works...