todo compilable, code cleanup