Refactor Test & Code