cleanup code a bit

Some formatting, some logic
while you're at it, first argument should be `err`, not `true`. And second should be `css`.