changes and code cleaning