refactored performance writing