Merged classes and added php version check