reconstruct whole logic.