Add livesearch keypressing and clean js code