Refactor for further development (ref gh-32).