Refactor code, delete unused functional.