refactoring: make formatter work without context