Event system implement. Full code refactor