cross browsers' fixes
minor refactor