improve regex
refactor and add animation