some cleaning to simplify the integration