Simplified and removed unused code
Minor code cleanup