creates closure to create new instance for each query

major javascript cleanup
Simplification and cleanup
cleanup to keep simplicity
experiment to try needing both actions to contain keywords