Adds default handling + cleaner code
infrastructure for unit tests + first unit tests + first fix!