rearrangement of implementation