Remove code duplication in WM resources