common implementation