Initial draft of modularised version.

Jira issue: 951