refactor log class a bit