Clean code to remove PHP warnings