[lib] refactored custom queries in ForumCategoryTable class