improve dom caching
- don't call appendChild if not needed
- don't overwrite style all the time
- don't overwrite function if it has same source