Introduce function for extraction of bg units
Add stuff for travis coverage