formatting + proper exception catching