Settings working, code cleanup