Separate code into function, add _util, add UI