Moving all PHP logic inline