Adding events + refactor