Refactor to read code better