Added domain padding
Lots of cleanup