partially implement events handling