I think it would be more appropriate to create a Utils class for handling stuff like this. This class would also be in the lib package.