initial load
refactor code
add some tests