Restructure the code to be more concise.