Move code into wrapper