Follow-up for #45

This is a follow-up pull request for replacing #45 - it contains the same commits but adds a new one intended to resolve conflicts