You could just combine these two functions, right?