Components clean up

- Removed unnecessary query logic and moved it to client side.
- Cleaned up client side scripts.