added functionality for inline usage