replace functional php files with functions