add coords, extend cardinality, reduce java code style