Move listeners into class
Call listeners from index function
Refactor base