introduce options object to avoid dom dependency
move more dom elements to config options