Added onclick + refactoring.