Split up funcs, update tests