remove unused
readability
split tree into its own source file