src: finished refractoring + clean up