Move most of the logic into vsite.