Restructure code for multiple handlers
Merge origin/master