split into header and impl
remove unnecessary cast