Clean resource and code