refactored formatter a bit