Simplified some code - removed unnecessary data