moved code to handlers and domain folders