Huge refactor, to allow for a wider set of elements
Default config is clean
Moved function to a better place