refactoring of clienttype