add spark
refactor