removed unessesary code plus refactor and added user prefs