refactored file appender