Restructure and added documentation