improved create file, if the parent directories does not exists they
will be created.
new method that finds the base class from the given child class.
null check integrated.