code is still a mess , looking for a good way interface for client-server logic