Fixed settings panel animation + cleaned up code