Remove hacky code from Doctine listener