Refactor code to match coding standard