jp & refactor code