code refactor with new handleWith