some refactoring & hack - some part of raphael was commented