Cleaned code here and there ;)