Move implementation of OnStatementAdded to single class