fix namespace and change class to non-static
add test