Change entry method to be useable as a lib.