Cleaned up existing code