refactor; make more safe
redifine interface