Typo bypassing code + remove misplaced code in deprecated function + some code cleaning