moved handlers directly to the constructor definition