Refactored and added settings page