Added basic code optimalization