removed old formatting implementation
added tests for formatting in try blocks, add startEndOverlapsWithStartEnd
drop duplicated code
code cleanup: move functions to the outer scope