reorganized, created: handleEvents, render