Board factory

This branch went a bit beyond the scope with some small fixes and cleanup.