tests and modularizing