Little rework on single php