add parsePattern, applyPattern, dark theme