refactoring code to have generall type class for easy reconizing for server