remove unnecessary captures