Separated php logic into separate file.