Remove unnecessary imports, use num::cast instead of from_int