set up namespace and constructor functions
setting up event listeners