Reorganize for testability
Adding a simple test