remove dead code
re-structure code in pkg ctrl