remove unused code and adding field declarations