Update: Move functionality to function