Feature/externalize

This is a work in progress for issue #279