Refactored interaction/controls into new file in js