Code rafactor