splash: refactor code