revamp of code structure
removed swp