Refactoring according to Contribution guidlines

Companion pr for #750