refactoring tirpan