Refactor The Code