Refactor code once againy