CRATEIT-161: Refactors search activity js
CRATEIT-161: Simplifies search handling