settings code cleanup