support head and other method in server; clean code