refactored to use abstract class for html table