Refactor to make way for dependency tracking