Layout compatibility
Added missing commit() or apply() call
Removed unnecessary wrapping
Refactoring return statement