Refactor and try to clear extra code. Also put a little more thought to make the pull request