Refactor RMQ to use vector