Cleaned up some unused vars and functions