repository and transformer patterns