rebuild using classes