Cleaned code in event layer.