dsl: cleaning, style fixes and micro optimizations