Removed unused code, improved indentation