Refactor code; add text animation