refactored some table methods