split into modules and added admin functionality