add license and further cleanup