Refactor to use std::list