removed redundancy with some js