starting to refactor indent dedent code