moved to Mojo, some code refurbishment