Refactored write back