refactor some code
fix html caption location