Move functionality to functions.