Normalize if-statements and use StringBuilder