Restructured code, modified some defaults