collapse brief if blocks

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
move buffer size into configurable macro

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>