some cleanup and better usage