Refactoring #36 and #53