refactor code
add support for test loading