Create a shared get function