made master class, remove unneeded PHP, cleaned code drift