Extract class building method