Restructure of code

better logging + extensions support