optimize code & stop counting contribution