Refactoring, make DRY