initial refractoring of docs application with first tests for it