Refactor the functions to one general get function