simplify code, remove unused types