Refactor code again