cleaned up formatting code