hm, the refacotring in this class is making things messier without really helping much. i would shove the whole code you have here below into a method cleanId($id), to prepare for further refactoring. but keep the order of things as before.