refactored ununsed code outside the compiled functions