code refactoring - modularising table stripping