Remove some files, refactor main