Further refactoring as per #34