Minor refactroing