Refactor to adapt changes in master