Refactor prepareXXX methods