Code re-factoring/formatting