first refactor
c##
trying to fix nullpointerexception