Cleaned code up