separated log interface from writer
refactored game loop