some fixes for settings page; extracted some blocks into new templates for easier maintenance