Cleanded up some code