Code restructuring and addition of Davis console emulation