Probably. The way you have it implemented seems normal for php land. I do not insist on changing it.