Refractor Code