Removing some php to simplify code