Split get() function into two functions