General cleanup

Added a call to GetNextEntities() rather than relying on the initial
query
General cleanup of control names and the handler function names.