try to use filetype as syntax style, misc refactoring