Simplify the code in general.