major reformating to comply to psr-2