refactore handler system