Refactored headphone working file