factor out some helpers
Remove extra blank lines