prism working, refactoring