make type-size detecting part more portable