Made API more Java friendly.