utilities and helper lib written by myself