Big refeactoring phase