Cleaned code a little