Cleaned code further