minor refactroing