REFACTOR CODE.