add menu support
add some structure
merge php code