Start moving shared non-GUI code to separate unit