remove unused constants
remove clear_properties from main()
some restructuring