Moved declarations and definitions to library internal namespace