additional refactoring...trying out new regex ...log stmts before blocks