Refactor and add tests for Master