extract localhost setup into method
extract memcache ports into constants