Moved resolving to router
Code style improvements