finalize stories and organize code