helpers for elegant java codes