Insert click dependency and some refactors