Huge refactory!!!!