refactor main module to reduce variable count and to improve clarity
add test for tabs