Refactored and cleaned up the wm entry