Minor refractoring and renaming