More setup code into a function to avoid unwanted execution upon import