Refactoring. Ref #26