further code cleaning