Refactor to use boundaries