Moved functions to shared directory