Removed depreciated code and small fixes