Changed APIs to make them Java 8 (Stream) conformant