Merge pull request #2 from tzh/master

refactoring
categories block check