API refinements, signal handling, refactoring, clean up