Refactor code with alternate methods