Getting rid of a lot of useless PHP code