refactored methods + new method for dynamic tbale cell length