refactor log append