refactor code to side by side diff