Formatting and Remove Unused Inputs