Cleaning up things, adding better code