API simplified; code cleanup