Additional simplification of code due to Out of mem excp.