refactoring server, start refatoring Model