Split up a function into two functions