Refactor in LAP and removal of dead code.