refactor and FIX SHIT
3.0.0
move domains code to different file
refactor to prototypes
3.1.0