removing common bits from here. Now in common repo.