initial signals code with tests
refactor