Refacto code, split code for PS 1.4 and 1.5