Remove some redundant folders and clean up code