code cleaning slightly