refactor code and use displayClassTable() to create a class specific
table