some commonly used code