move main handler to one file
add options