Beginning of re-factor