Remove some unused code and #defines
Remove unused definitions