Major code Cleaning