Moved interaction functions to their own file