started refactoring. Build now, but it is sort of useless (no active listeners at teh time)
refactoring code